package com.zpark.servlet_response;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: com.zpark.servlet_response
 * @ClassName: ServletResponseDemo04
 * @Description:
 * @author: RZS
 * @date: 2023/3/9  17:31
 */
@WebServlet("/sp04.do")
public class ServletResponseDemo04 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 获取字节输出流对象
        ServletOutputStream outputStream = resp.getOutputStream();
        outputStream.println("<h1>hello Servlet</h1>");
    }
}
